<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="vue.js"></script>
</head>
<body>

<div id="app">
    <!--//dom直接被删除了-->
    <!--<div v-if="show" data-test="v-if">{{message}}</div>-->
    <!--//display:none-->
    <!--<div v-show="show" data-test="v-show">{{message}}</div>-->

    //用key值区分
    <div v-if="show === 'a'">this is a</div>
    <div v-else-if="show === 'b'">this is b</div>
    <div v-else>this is other</div>
</div>

<script>
    var vm = new Vue({
        el: "#app",
        data: {
            show: "a",
            message: "hello world"
        }
    })
</script>
</body>
</html>